package com.atguigu.gulimall.ware.dao;

import com.atguigu.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author xjx
 * @email xiajinxiang163@163.com
 * @date 2021-04-11 14:34:07
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    Long getSkusHasStock(@Param("skuId") Long skuId);

    List<Long> listWareIdsHasSkuStock(@Param("skuId") Long skuId);

    Integer lockSkuStock(@Param("skuId")Long skuId,@Param("wareId") Long aLong,@Param("num") Integer num);
}
